<?php
include_once("../../configure/configure.php");		//--> global var
include_once("../configure/admin.config.inc.php");	//--> admin global var
include_once("Smarty.class.php");					//--> out template

include_once("impl/UserGroupImpl.php");				//--> Menu group class

require_once("controlHeader.php");					//--> system control header
require_once("../controlOperate.php");				//-->

$userGroupImpl 	= new UserGroupImpl(DB_TAG_SYSTEM);		//--> Menu group instance

if(isset($_GET['id']) && !empty($_GET['id'])){
	$id = $_GET['id'];

	if($gid == $id){
		$error_message = 'invalid delete user group.';
	}else{
		$isOK = $userGroupImpl->delete($id);
		if($isOK)
			$error_message = 'delete group successfully.';
		else 
			$error_message = 'delete group fail.';
	}
}

echo "<script language='javascript'>";
echo "alert(\"$error_message\");";
echo "location.href=\"".$_SERVER['HTTP_REFERER']."\";";
echo "</script>";

//$backurl = $_SERVER['HTTP_REFERER'];
//header("Location: $backurl");
?>
